<template>
  <view v-if="src">
    <!-- #ifdef H5 -->
    <iframe width="100%" height="100%" :src="src" :title="title" />
    <!-- #endif -->
    <!-- #ifndef H5 -->
    <web-view :webview-styles="wbStyles" :src="src" :fullscreen="false" />
    <!-- #endif -->
  </view>
</template>
 
<script>
export default {
  data() {
    return {
      title: '',
      src: '',
      wbStyles: {
        width: '100%',
        height: '100%',
      },
    }
  },
  onLoad(option) {
    this.title = option?.title;
    this.src = option?.src;
    if(!this.src) {
      uni.showToast({
        title: '尊敬的大人对对不不起起！此游戏出了点小问题~',
        icon: 'none',
      });
      uni.navigateBack();
    }
  },
}
</script>